home *** CD-ROM | disk | FTP | other *** search
/ Interactive Media Design Review 1999 / Interactive Media Design Review 1999.iso / pc / Demos / Bombardier_PC / BSCRIPTS.CST / 00112_Script_mapRollover < prev    next >
Text File  |  1999-04-25  |  3KB  |  92 lines

  1. -- ⌐ 1998 @radical.media, inc. & Concurrent New Media Group, L.L.C.
  2. -- Developed for Bombardier, Inc.
  3. --
  4. -- All programming developed by: 
  5. -- Robert Fabricant, Valerie Valoueva, Ossi Shaked, 
  6. -- Henry Sauvageot, Chris Howell & Chris Girand
  7. --
  8. -- Use of this code by parties other than @radical.media, inc. or their
  9. --agents 
  10. -- without the express written consent of @radical.media, inc. AND Concurrent 
  11. -- New Media Group, L.L.C. is strictly prohibited.
  12. ------------------------------------------------------
  13. --If the mouse rolls over the sprite to which this behavior is attached, and this sprite's castMember is called "NeuName", it's switched to castMemner "NeuName-rol" and the cast member of a sprite occupied by invisible place holder  "invis,-Suffix1"  is switched to castMember  "NeuName-Suffix1", the cast member of a sprite occupied by invisible place holder  "invis,-Suffix2"  is switched to castMember  "NeuName-Suffix2" and so on.
  14.  
  15.  
  16. property mySprite, neuName, rolName,linkedSpriteList,directSprite
  17.  
  18. on new me
  19.   set mySprite = the spriteNum of me
  20.   set neuName = getNeutralName(me)
  21.   set rolName = neuName&"-rol"
  22.   set linkedSpriteList = getLinkedSpriteList (me)
  23.   set directSprite = getSpriteNumFromMemberName ("directions")
  24.   set the visible of sprite directSprite = TRUE
  25. end
  26.  
  27. on getLinkedSpriteList me
  28.   set linkedSpriteList = [:]
  29.   repeat with spriteNum = 1 to 120
  30.     set aMember = the member of sprite spriteNum
  31.     set aMemberNum = the memberNum of sprite spriteNum
  32.     if aMemberNum <> 0 then
  33.       set aName = the name of member aMember
  34.       if aName contains "invis," then
  35.         set linkedSprite = spriteNum
  36.         set the stretch of sprite linkedSprite = FALSE
  37.         set suffix = item 2 of aName
  38.         addProp linkedSpriteList,linkedSprite,suffix
  39.       end if
  40.     end if
  41.   end repeat
  42.   return linkedSpriteList
  43. end 
  44.  
  45.  
  46. on mouseWithin me
  47.   set the visible of sprite directSprite = FALSE
  48.   set the member of sprite mySprite = member  rolName
  49.   repeat with index = 1 to count(linkedSpriteList)
  50.     set linkedSprite = getPropAt(linkedSpriteList,index)
  51.     set suffix = getProp(linkedSpriteList,linkedSprite)
  52.     set linkedName = neuName&suffix
  53.     put linkedName
  54.     set the member of sprite linkedSprite = member linkedName 
  55.   end repeat
  56. end
  57.  
  58. on mouseEnter me
  59.   puppetsound 3, "subroll"
  60. end
  61.  
  62.  
  63. on mouseLeave me
  64.   set the member of sprite mySprite = member  neuName
  65.   repeat with index = 1 to count(linkedSpriteList)
  66.     set linkedSprite = getPropAt(linkedSpriteList,index)
  67.     set suffix = getProp(linkedSpriteList,linkedSprite)
  68.     set linkedName = "invis,"&suffix
  69.     set the member of sprite linkedSprite = member linkedName 
  70.   end repeat
  71.   updatestage
  72.   set the visible of sprite directSprite = TRUE
  73. end
  74.  
  75.  
  76. on getNeutralName me
  77.   set aMember = the member of sprite mySprite
  78.   set Name = the name of member aMember
  79.   if Name contains "-" then
  80.     repeat with i = the Number of Chars of Name down to 1
  81.       if char i of Name <> "-" then 
  82.         delete char i of Name
  83.       else
  84.         delete char i of Name
  85.         exit repeat
  86.       end if
  87.     end repeat
  88.   end if
  89.   return Name
  90. end
  91.  
  92.